Never do implicit paints for foreign windows
authorMatthias Clasen <mclasen@redhat.com>
Tue, 8 Dec 2009 15:09:04 +0000 (10:09 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 8 Dec 2009 15:09:04 +0000 (10:09 -0500)
They don't need double buffer combination since they have no
client-side children, and creating pixmaps for them is risky
since they could disappear at any time.

May fix bug 598476 and 603652.

gdk/gdkwindow.c

index 04048517633913c4d710e56f2512ce91b4dcfff7..78b19e884dd46e535b2396ac498bfa4d8274b0b0 100644 (file)
@@ -2611,6 +2611,14 @@ gdk_window_begin_implicit_paint (GdkWindow *window, GdkRectangle *rect)
       private->implicit_paint != NULL)
     return FALSE; /* Don't stack implicit paints */
 
+  /* Never do implicit paints for foreign windows, they don't need
+   * double buffer combination since they have no client side children,
+   * and creating pixmaps for them is risky since they could disappear
+   * at any time
+   */
+  if (private->window_type == GDK_WINDOW_FOREIGN)
+    return FALSE;
+
   paint = g_new (GdkWindowPaint, 1);
   paint->region = gdk_region_new (); /* Empty */
   paint->x_offset = rect->x;